home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig16_32.jar
/
Ch16
/
Fig16_32
/
Fig16_32.cpp
Wrap
C/C++ Source or Header
|
1997-11-10
|
453b
|
20 lines
// Fig. 16.32: fig16_32.cpp
// Using strspn
#include <iostream.h>
#include <string.h>
int main()
{
char *string1 = "The value is 3.14159";
char *string2 = "aehilsTuv ";
cout << "string1 = " << string1
<< "\nstring2 = " << string2
<< "\n\nThe length of the initial segment of string1\n"
<< "containing only characters from string2 = "
<< strspn( string1, string2 ) << endl;
return 0;
}